﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.WindowsAzure.StorageClient;
using Microsoft.WindowsAzure;

namespace PC.AzureMultiApp.Storage
{
    /// <summary>
    /// Context to Access to Storage Tables
    /// </summary>
    public class StorageContext : TableServiceContext
    {
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="baseAddress">Base Url</param>
        /// <param name="credentials">Storage Credentials</param>
        public StorageContext(string baseAddress, StorageCredentials credentials)
            : base(baseAddress, credentials)
        {
        }

        public IQueryable<AzureApplicationEntity> Applications
        {
            get
            {
                return this.CreateQuery<AzureApplicationEntity>("azuremultiapp");
            }
        }

        public IQueryable<AzureCounterEntity> Counters
        {
            get
            {
                return this.CreateQuery<AzureCounterEntity>("WADPerformanceCountersTable");
            }
        }

        public IQueryable<AzureEventEntity> AzureEvents
        {
            get
            {
                return this.CreateQuery<AzureEventEntity>("WADWindowsEventLogsTable");
            }
        }

    }
}
